/* static/user/css/user-center.css */
/***** 用户区域样式 *****/
.user-area {
    position: relative;
    cursor: pointer;
    z-index: 999;
}

.user-info {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-info:hover {
    background: rgba(255, 68, 0, 0.05);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    object-fit: cover;
    margin-right: 12px;
    box-shadow: 0 2px 8px rgba(255, 68, 0, 0.1);
    transition: transform 0.3s;
}

.user-avatar:hover {
    transform: scale(1.05);
}

.username {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s;
}

.icon-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #666;
    margin-left: 8px;
    transition: all 0.3s;
}

.user-info:hover .icon-arrow {
    border-top-color: var(--primary-color);
    transform: translateY(2px);
}

/***** 下拉菜单样式 *****/
.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 180px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    padding: 8px 0;
}

.user-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu li {
    list-style: none;
}

.user-menu a {
    position: relative;
    display: flex;
    align-items: center;
    padding: 10px 20px;
    font-size: 14px;
    color: #666;
    transition: all 0.25s;
}

.user-menu a::before {
    content: "";
    position: absolute;
    left: 8px;
    width: 5px;
    height: 5px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
}

.user-menu a:hover {
    background: rgba(255, 68, 0, 0.05);
    color: var(--primary-color);
    padding-left: 28px;
}

.user-menu a:hover::before {
    opacity: 1;
}

/***** 用户中心弹窗样式 *****/
.user-center-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    background: #fff;
    width: 500px;
    max-width: 90vw;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: none;
    opacity: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-center-modal.show .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

/***** 标签页样式 *****/
.tabs {
    display: flex;
    border-bottom: 1px solid #eee;
}

.tab {
    flex: 1;
    padding: 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 15px;
    color: #666;
    transition: all 0.3s;
    position: relative;
}

.tab::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.tab.active {
    color: var(--primary-color);
}

.tab.active::after {
    transform: scaleX(1);
}

/***** 表单样式 *****/
.tab-panel {
    display: none;
    padding: 20px;
}

.tab-panel.active {
    display: block;
}

.avatar-upload {
    position: relative;
    text-align: center;
    margin: 20px 0;
}

.avatar-label {
    display: inline-block;
    cursor: pointer;
    position: relative;
    border-radius: 50%;
    transition: transform 0.3s;
}

.avatar-label:hover {
    transform: scale(1.05);
}

#avatarPreview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    object-fit: cover;
}

.edit-icon {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: var(--primary-color);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    opacity: 0.9;
    transition: all 0.3s;
}

.avatar-label:hover .edit-icon {
    opacity: 1;
    transform: scale(1.1);
}

.hidden-file-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
    width: 0;
    height: 0;
}

.form-group {
    margin: 20px 0;
    position: relative;
}

.form-group input {
    width: 80%;
    padding: 12px 16px;
    border: 1px solid #eee;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 68, 0, 0.1);
    outline: none;
}

.gender-group {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.gender-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.gender-group input[type="radio"] {
    display: none;
}

.gender-group span {
    padding: 8px 20px;
    border-radius: 20px;
    transition: all 0.3s;
}

.male {
    background: rgba(25, 118, 210, 0.1);
    color: #1976d2;
}

.female {
    background: rgba(216, 27, 96, 0.1);
    color: #d81b60;
}

.gender-group input:checked + span {
    background: var(--primary-color);
    color: #fff;
}

.save-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 25px;
}

.save-btn:hover {
    background: #ff5722;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 68, 0, 0.2);
}

/***** 响应式设计 *****/
@media (max-width: 768px) {
    .modal-content {
        width: 90%;
    }

    .user-menu {
        width: 140px;
    }

    .form-group input {
        padding: 10px 14px;
    }

    .gender-group {
        flex-direction: column;
        gap: 12px;
    }
}

/* static/user/css/user-center.css 新增内容 */
/* Tab加载状态 */
.tab.loading::after {
    animation: tabLoading 1.5s infinite;
}

@keyframes tabLoading {
    0% { transform: scaleX(0); }
    50% { transform: scaleX(1); }
    100% { transform: scaleX(0); }
}

/* 头像上传状态 */
#avatarPreview.uploading {
    position: relative;
    opacity: 0.7;
}

#avatarPreview.uploading::after {
    content: '上传中...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.hidden-file-input {
    display: none;
}

/* 表单错误状态 */
.form-group.error input {
    border-color: #ff4444 !important;
    box-shadow: 0 0 0 2px rgba(255,68,0,0.1);
}

.form-group.error::after {
    content: '⚠ ' attr(data-error);
    color: #ff4444;
    font-size: 12px;
    position: absolute;
    bottom: -20px;
    left: 0;
}


:root {
    --primary-color: #ff4400;
}